﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Store/StoreMastePage.Master" AutoEventWireup="true" CodeBehind="ViewStockCard.aspx.cs" Inherits="logicunivesityinventorystore.ViewStockCard" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
   <script type="text/javascript" language="javascript">
       function printDiv() {

           var toPrint = document.getElementById("divPrint");
           var printWindow = window.open("", "", 'left=500,right=500,width=500,height=500');
           printWindow.document.write('<center>'+toPrint.innerHTML+'</center>');
           printWindow.document.close();
           printWindow.focus();
           printWindow.print();
           printWindow.close();
       
       }
   </script>
</asp:Content>
<asp:Content ID="Content2" runat="server" 
    contentplaceholderid="ContentPlaceHolder2">
        <h1>View Stock Card</h1>
        <table>
            <tr>
            <td><asp:Label ID="lblSelectCategory" runat="server" Text="Select Category"></asp:Label></td><td>&nbsp;</td>
            <td><asp:DropDownList ID="ddlCategoryType" runat="server" 
            DataSourceID="ObjectDataSource1" DataTextField="CategoryName" 
            DataValueField="CategoryID" AutoPostBack="True"></asp:DropDownList></td><td>&nbsp;</td>
            <td><asp:Label ID="lblSelectItem" runat="server" Text="Select Item"></asp:Label></td><td>&nbsp;</td>
            <td><asp:DropDownList ID="ddlItemName" runat="server" 
            DataSourceID="ObjectDataSource2" DataTextField="Description" 
            DataValueField="ItemCode">
            </asp:DropDownList></td>
            <td>&nbsp;</td>
            <td><asp:Button ID="btnFind" runat="server" Text="Find" onclick="btnFind_Click" /></td>
            </tr>
            <tr><td>&nbsp;</td></tr>
            <tr><td>&nbsp;</td></tr>
        </table>
        
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            SelectMethod="FindAllCategory" TypeName="BusinessLogicLayer.ItemFacade">
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
            SelectMethod="FindAllByCategory" TypeName="BusinessLogicLayer.ItemFacade">
            <SelectParameters>
                <asp:ControlParameter ControlID="ddlCategoryType" Name="categoryID" 
                    PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
         <div id="divPrint">
         <table>
        <tr><td>
       
        <asp:DetailsView ID="dvstockCardItem" runat="server" Height="50px" 
            Width="156px">
        </asp:DetailsView>
       <br />
         
        <asp:GridView ID="gvStockView" runat="server">
        </asp:GridView>
        </td></tr>
        </table>
         </div>
        <br />
      
        <asp:Button ID="btnPrint" runat="server" Text="Print" 
            OnClientClick="printDiv()" onclick="btnPrint_Click"/>
            </asp:Content>

<asp:Content ID="Content3" runat="server" 
    contentplaceholderid="ContentPlaceHolder3">
 
                </asp:Content>
<asp:Content ID="Content4" runat="server" 
    contentplaceholderid="ContentPlaceHolder4">
     
                </asp:Content>
<asp:Content ID="Content5" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
          
                </asp:Content>
<asp:Content ID="Content6" runat="server" 
    contentplaceholderid="ContentPlaceHolder6">
     
                </asp:Content>
<asp:Content ID="Content7" runat="server" 
    contentplaceholderid="ContentPlaceHolder7">
              
                </asp:Content>


